package com.briup.estore.web.controller;

import com.briup.estore.service.CategoryService;
import com.briup.estore.vo.CategoryInfoVO;
import com.briup.estore.web.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

@RestController
@Api(tags = "分类模块")
@RequestMapping("/category")
public class CategoryController {
    @Resource
    private CategoryService categoryService;

    @GetMapping("/list")
    @ApiOperation("所有分类")
    public Result showCategory() {
        List<CategoryInfoVO> all = categoryService.findAll();
        return Result.success(all);
    }
}
